<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>    
<% //Grab the username and emp_id from the session
String uname=(String)session.getAttribute("userName");
String emp_id=(String)session.getAttribute("emp_id");
int ei=Integer.parseInt(emp_id);
String phone=null;
String qualification=null;
String gender=null;

%>
<%
String query="select employee.phone,employee.gender from employee where employee.emp_id='"+ei+"'";
Connection db_conn = null;
Statement statement = null;
PreparedStatement pstmt;
ResultSet rs;
try{
Class.forName("com.mysql.jdbc.Driver");
String url= "jdbc:mysql://localhost:3306/db";
db_conn = DriverManager.getConnection( url,"root", "root" );
statement = db_conn.createStatement();
rs=statement.executeQuery(query);
while (rs.next()) { // parse the results
phone=rs.getString("employee.phone");
gender=rs.getString("employee.gender");

}
db_conn.close();
} catch(SQLException e){
e.printStackTrace();
out.println("sql not found");
out.println(e);
} catch(ClassNotFoundException e){
e.printStackTrace();
out.println(e);
}


%>    


<h1>Hello <span class="green"> <%= uname%></span></h1>
<h1>It's <span class="green"><%= new java.util.Date() %></span></h1>
<table width="400" align="center">
    <tr bgcolor="#EEEEEE" height="20px">
        <th width="125" scope="col"></th>
        <th width="225" scope="col">Description</th>
    </tr>
    <tr bgcolor="#FFFFFF">
        <td>Name</td>
        <td><%= uname%></td>
    </tr>
    <tr bgcolor="#FCFCFC">
        <td height="24">Phone</td>
        <td><%= phone%></td>
    </tr>
    
    <tr bgcolor="#FFFFFF">
        <td>Gender</td>
        <td><%= gender%></td>
    </tr>
    <tr bgcolor="#FCFCFC">
        <td>tasks allocated</td>
        <td>
            <jsp:include page="task.jsp" />
            
            
        </td>
    </tr>
    <tr bgcolor="#FCFCFC">
        <td>projects_involved</td>
        <td><jsp:include page="project.jsp" /></td>
    </tr>
    <tr >
        <td></td>
        <td>
            <form method="post" class="searchform" action="user/personal info/edit_personal_info.jsp">
                <p><input type="hidden" name="ename" value="<%= uname%>" />
                    <input type="hidden" name="e_id" value="<%= emp_id%>" />
                    <input type="hidden" name="equalification" value="<%= uname%>" />
                    <input type="hidden" name="ephone" value="<%= phone%>" />
                    <input type="hidden" name="egender" value="<%= gender%>" />
                    <input type="hidden" name="modify" value="no" />
                <input type="submit" name="Edit" class="button" value="Edit" /></p>
            </form>    
            
            
        </td>
    </tr>
    
</table>
